import React, { PropTypes } from 'react';

import QueueAnim from 'rc-queue-anim';

import { connect } from 'dva';

import './less/mask.less';

function Mask({mask}){
    const {maskStatus,maskContent} = mask;
    let _compent =
      <QueueAnim
        animConfig={{opacity:[1, 0],right:[0, '-100%']}}
        duration = {800}
        ease = {['easeOutQuart','easeInSine']}
      >
      {
        maskStatus?
        [
            <div className="mask-container" key='maskdemo'>
              {maskContent}
            </div>
        ]:null
      }
      </QueueAnim>
    return _compent;
}

function mapStateToProps({ mask }) {
  return { mask };
}

export default connect(mapStateToProps)(Mask);
